import { NestFactory } from '@nestjs/core';
import { VersioningType } from '@nestjs/common';
import { AppModule } from './app.module';
import * as session from "express-session"



async function bootstrap() {
  const app = await NestFactory.create(AppModule);

  // URL版本控制
  app.enableVersioning({
    type: VersioningType.URI
  })


  // 声明一个salt
  app.use(session({
    secret: "jiahe",
    name: 'jiahe.sid',
    rolling: true,
    cookie: {
      maxAge: null
    }
  }))
  console.log('开启服务, 端口3000,w 接口地址： http://localhost:3000');
  await app.listen(3000);
}
bootstrap();
